package com.wlhse.controller;

import com.wlhse.dto.inDto.RouteTaskRecordInDto;
import com.wlhse.service.RouteTaskRecordService;
import com.wlhse.util.GetCurrentUserIdUtil;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@RestController("RouteTaskRecordController")
@RequestMapping("/api/v3")
//巡检
public class RouteTaskRecordController {
    @Resource
    private RouteTaskRecordService routeTaskRecordService;

    @Resource
    private GetCurrentUserIdUtil getCurrentUserIdUtil;

    @RequestMapping(value = "/accident_task_record", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
    public String selectAccidentRecord(@ModelAttribute RouteTaskRecordInDto routeTaskRecordInDto, HttpServletRequest request) {
        return routeTaskRecordService.getRouteTaskRecord(routeTaskRecordInDto, getCurrentUserIdUtil.getUserId(request));
    }
}
